package cn.vcjf.weapp.common.util;


import java.util.Random;

/**
 * @author 郑自航
 */
public class StringUtil {

	public static String upperInitialCase(String str) {
		char[] ch = str.toCharArray();
		if (ch[0] >= 'a' && ch[0] <= 'z') {
			ch[0] = (char) (ch[0] - 32);
		}
		return new String(ch);
	}
	/**
	 * 获取6位验证码
	 *   返回：int 798162
	 */
	public static String getRandNum() {
		Random random = new Random();
		int number=0;
		String code="";
		for(int i = 0; i < 6;i++) {
			number=Math.abs(random.nextInt())%10;
			code+=String.valueOf(number);
		}
		return code;
	}
/*	public static List<Integer> parseIntegerList(String strList, List<Integer> listInt){
		List<String> listStr = Arrays.asList(strList.split(","));
		listInt =new ArrayList<Integer>(listStr.size());
		CollectionUtils.collect(listStr, 
                 new Transformer(){
                   public java.lang.Object transform(java.lang.Object input){
                     return Integer.parseInt((String)input);
                   }
                 } ,listInt );
       return listInt;
	}*/
	
//	public static void main(String[] args) {
//		List<String> list = new ArrayList<String>();
//		list.add("1");
//		list.add("2");
//		List<Integer> listint = null;
//		
//		listint = parseIntegerList(list, listint);
//		System.out.println(listint.getClass());
//		System.out.println(listint);
//	}

}
